<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<form action="http://locahost:8080/demo" method="get">
			<input type="text" name ="account" />
			<input type="password" name="password"/>
			<button type="submit">提交</button>
		</form>
		<script src="./js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$("button").click(function(){
				let account = $("input[name='account']").val();
				if(account.trim().length === 0){
					return false; //如果按钮类型是submit，则事件必须返回false才会阻止
				}
				$("form").submit();
			});
		</script>
	</body>
</html>
